﻿using System;
using System.Reflection;
using Codeflows.Results;
using Codeflows.Tracking;

namespace Codeflows.Dispatch
{
    abstract class ActionMethodDescriptor
    {
        protected ActionMethodDescriptor(MethodInfo methodInfo)
        {
            if (methodInfo == null) throw new ArgumentNullException("methodInfo");
            Name = methodInfo.Name;
        }

        public string Name { get; private set; }
        public bool IsStart { get { return Name == "Start"; } }

        public abstract Result ExecuteAction(Codeflow instance, CodeflowInstance codeflowInstance);        
    }
}
